package com.dtu.distributed.generator;

public class TemperatureGenerator {

	private int normalTemp;

	public TemperatureGenerator(int temp) {
		this.normalTemp = temp;
	}

	public int getBinomial() {
		int x = 0;
		// The range is 10 (+/- 5 degrees) binomial distributed (0.5) around the given temperature.
		for(int i = 0; i < 10; i++) {
			if(Math.random() < 0.5)
				x++;
		}
		// Because x is a number from 0-10, -5 is subtracted from the normalTemp.
		return x+normalTemp-5;
	}

	public int getNormalTemp() {
		return normalTemp;
	}

	public void setNormalTemp(int normalTemp) {
		this.normalTemp = normalTemp;
	}

}
